// 权限
import request from '@/utils/request'

// 根据id删除角色权限
export const delRightsById = (roleId, rightId) => {
  return request({
    url: `roles/${roleId}/rights/${rightId}`,
    method: 'DELETE'
  })
}

// 获取所有权限列表
export const rights = (type) => {
  return request({
    url: `rights/${type}`,
    method: 'GET'
  })
}

// 根据角色id分配权限
export const allotRights = (data) => {
  return request({
    url: `roles/${data.id}/rights`,
    method: 'POST',
    data
  })
}
